<extend name="Index/index"/>

<block name="content">
    <!--<div class="view-product" style="margin-top: 50px">-->
    <div class="info-center">
        <div class="manage-head">
            <h6 class="padding-left manage-head-con">{{$title}}</h6>
        </div>
        <div class="offcial-table input-table table-margin clearfix">
            <div class="demoTable">
                <div class="layui-inline">
                    <a href="{{:U('Banner/addBanner')}}" class="layui-btn layui-btn-normal">上传banner图片</a>
                </div>
            </div>
            <if condition="$bannerList eq null">
                <div class="tr non-info show border-bottom-none">
                    <span>没查询到符合条件的记录</span>
                </div>
                <else />
                <table class="layui-table text-center">
                    <tr>
                        <th class="text-center">ID</th>
                        <th class="text-center">图片名</th>
                        <th class="text-center">缩略图</th>
                        <th class="text-center">宽</th>
                        <th class="text-center">高</th>
                        <th class="text-center">是否显示</th>
                        <th class="text-center">链接地址</th>
                        <th class="text-center">上传时间</th>
                        <th class="text-center">操作</th>
                    </tr>
                    <foreach  name="bannerList" item="vo" key="k">
                        <tr>
                            <td>{{$vo.id}}</td>
                            <td>{{$vo.name}}</td>
                            <td><img src="{{:get_img_url('__ROOT__/Banner/',$vo['image'],50)}}"onclick="showBig(this)"></td>
                            <td>{{$vo.width}}</td>
                            <td>{{$vo.height}}</td>
                            <td>
                                <eq name="vo.is_show" value="1">
                                    <a href="{{:U('Banner/isShow',array('id'=>$vo['id'],'show'=>$vo['is_show']))}}"><i class="layui-icon" style="color: #1E9FFF;">&#xe618;</i></a>
                                    <else/>
                                    <a href="{{:U('Banner/isShow',array('id'=>$vo['id'],'show'=>$vo['is_show']))}}"><i class="layui-icon" style="color: #1E9FFF;">&#x1006;</i></a>
                                </eq>
                            </td>
                            <td><a href="{{$vo.url}}">{{$vo.url}}</a></td>
                            <td>{{:substr($vo['create_time'],0,10)}}</td>
                            <td><a href="{{:U('Banner/editBanner',array('id'=>$vo['id']))}}" class="layui-btn layui-btn-normal">编辑</a></td>

                        </tr>
                    </foreach>
                    <!--<tr>-->
                        <!--<td colspan="4"><div class="sabrosus">{{$page}}</div></td>-->
                    <!--</tr>-->
                </table>
            </if>

        </div>
    </div>
    <!--</div>-->
    <script>
        function showBig(obj) {
            var src = obj.src;
            src = src.replace(/50_/,"");
            window.location.href = src;
        }
    </script>
</block>